-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Geeksevent #41
base: master
Are you sure you want to change the base?
Geeksevent #41
Conversation
|
||
const controllers = require('./controllers'); | ||
const bodyParser = require('body-parser'); | ||
const dbConnection = require('./database/db_connect') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you requiring dbconnection in your app
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
becuese i have a problem to save data i enter in the form in data base
its necessary to require dbconnection app
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not. You shouldn't require your dbConnection in your app.
const Events = require('../database/events'); | ||
|
||
exports.get = (req, res, next) => { | ||
res.render('event', {event: true, script: 'event_dom.js', title: 'My page' }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the event: true
?
|
||
exports.post = (req, res, next) => { | ||
|
||
const schema = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Separate the queries from the controllers
@@ -0,0 +1,3 @@ | |||
const Events = require('../events') | |||
|
|||
module.exports = (object) => new Events({ object }).save(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good, you've created a query, and used it where?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
event.js in controller
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No you haven't required it in event.js
.
No description provided.